import React, {useContext} from 'react';
import Theme from '@/components/15- 常用Hooks/07- useContext/userContext.js';

const {ThemeContext, ThemeContextTwo} = Theme;
const FunUseContextTwo = () => {
    const {num, setNum} = useContext(ThemeContext);
    const {num1, setNum1} = useContext(ThemeContextTwo);
    return (
        <div>
            <h4>FunUseContextTwo</h4>
            <button onClick={() => {
                setNum(num + 1);
            }}>改变num ==> {num}</button>
            <p>
                <button onClick={() => {
                    setNum1(num1 + 10);
                }}>改变num1 ==> {num1}</button>
            </p>
        </div>
    );
};

export default FunUseContextTwo;